home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 2 / Apprentice-Release2.iso / Source Code / C / Frameworks / Dragonsmith 1.1.1 / CW 4.5 Update / AppleEventQueue.h < prev    next >
Encoding:
C/C++ Source or Header  |  1994-07-04  |  1.2 KB  |  40 lines  |  [TEXT/MMCC]

  1. /*
  2.     AppleEventQueue.h
  3.  
  4.   modified by Francis H Schiffer, 3rd, 1994 July 1 to support Universal Headers
  5. */
  6.  
  7. #pragma once
  8.  
  9. // Format for an Apple event handler function
  10. //    typedef pascal OSErr (*AEHandlerFunc) (AppleEvent*, AppleEvent*, long);    /* original */
  11. #include     <AppleEvents.h>                     /* fhs 1994 july 1 */
  12. typedef  AEEventHandlerUPP  AEHandlerFunc;     /* fhs 1994 july 1 */
  13.  
  14. struct PendingAERec {    /* fhs 1994 july 1 */
  15.     AppleEvent            event;
  16.     AppleEvent            reply;
  17.     long                    refcon;
  18.     AEHandlerFunc        handler;
  19.     struct PendingAERec    **next;
  20.     };
  21. };
  22.  
  23. typedef struct PendingAERec PendingAERec;
  24.  
  25. //    class AppleEventQueue : indirect {    /* original */
  26. class AppleEventQueue {        /* fhs 1994 july 1 */
  27.  
  28.     protected:
  29.         PendingAERec    **head;            // Handle to a record for the first pending Apple event
  30.         PendingAERec    **tail;            // Handle to a record for the last pending Apple event
  31.         short            numAEvents;        // Number of pending Apple events
  32.         
  33.     public:
  34.                         AppleEventQueue (void);        // Constructor
  35.         virtual OSErr        Put (AppleEvent *event, AppleEvent *reply, AEHandlerFunc handler, long refcon);
  36.         virtual OSErr        Get (AppleEvent *event, AppleEvent *reply, AEHandlerFunc *handler, long *refcon);
  37.  
  38. };
  39.  
  40.